package com.tuniu.agents.tools.flights.model;

public class DetailModel {
    /**
     * Query ID
     */
    private String queryId;

    /**
     * System ID
     */
    private String systemId;

    /**
     * Flight numbers
     */
    private String flightNos;

    /**
     * Departure city code
     */
    private String orgCityCode;

    /**
     * Departure city IATA code
     */
    private String orgCityIataCode;

    /**
     * Departure city name
     */
    private String orgCityName;

    /**
     * Arrival city code
     */
    private String dstCityCode;

    /**
     * Arrival city IATA code
     */
    private String dstCityIataCode;

    /**
     * Arrival city name
     */
    private String dstCityName;

    /**
     * Departure date
     */
    private String deptDate;

    /**
     * Return date, not applicable for one-way trips
     */
    private String backDate;

    /**
     * Cabin class: 0: Unlimited, 1: Economy, 2: Business, 3: First Class, 4: Premium Economy
     */
    private Integer cabinClass;

    /**
     * Whether it is a transfer flight
     */
    private boolean isTransfer;

    public String getQueryId() {
        return queryId;
    }

    public void setQueryId(String queryId) {
        this.queryId = queryId;
    }

    public String getSystemId() {
        return systemId;
    }

    public void setSystemId(String systemId) {
        this.systemId = systemId;
    }

    public String getFlightNos() {
        return flightNos;
    }

    public void setFlightNos(String flightNos) {
        this.flightNos = flightNos;
    }

    public String getOrgCityCode() {
        return orgCityCode;
    }

    public void setOrgCityCode(String orgCityCode) {
        this.orgCityCode = orgCityCode;
    }

    public String getOrgCityIataCode() {
        return orgCityIataCode;
    }

    public void setOrgCityIataCode(String orgCityIataCode) {
        this.orgCityIataCode = orgCityIataCode;
    }

    public String getOrgCityName() {
        return orgCityName;
    }

    public void setOrgCityName(String orgCityName) {
        this.orgCityName = orgCityName;
    }

    public String getDstCityCode() {
        return dstCityCode;
    }

    public void setDstCityCode(String dstCityCode) {
        this.dstCityCode = dstCityCode;
    }

    public String getDstCityIataCode() {
        return dstCityIataCode;
    }

    public void setDstCityIataCode(String dstCityIataCode) {
        this.dstCityIataCode = dstCityIataCode;
    }

    public String getDstCityName() {
        return dstCityName;
    }

    public void setDstCityName(String dstCityName) {
        this.dstCityName = dstCityName;
    }

    public String getDeptDate() {
        return deptDate;
    }

    public void setDeptDate(String deptDate) {
        this.deptDate = deptDate;
    }

    public String getBackDate() {
        return backDate;
    }

    public void setBackDate(String backDate) {
        this.backDate = backDate;
    }

    public Integer getCabinClass() {
        return cabinClass;
    }

    public void setCabinClass(Integer cabinClass) {
        this.cabinClass = cabinClass;
    }

    public boolean isTransfer() {
        return isTransfer;
    }

    public void setTransfer(boolean transfer) {
        isTransfer = transfer;
    }

    public void convertAndSetCabinClass(String str) {
        if (str == null) {
            return;
        }

        this.cabinClass = switch (str) {
            case "经济舱" -> 1;
            case "公务舱" -> 2;
            case "头等舱" -> 3;
            case "超级经济舱" -> 4;
            default ->
                // 0 Unlimited
                    0;
        };
    }
}
